<include file="../Public/header" />
<script data-main="__PUBLIC__/admin/js/page/cms/cate/addcate" src="__PUBLIC__/admin/js/lib/requirejs/require.js"></script>
</head>

<body>
  <div class="page">
    <div class="page-hd">
      <h1>
        添加栏目
      </h1>
    </div>

    <div class="form">
      <form id="J_form" action="{:URL('cms/Cate/doaddcate')}" method="POST" enctype="multipart/form-data">
        <input type="hidden" name="id" id="id" value="{$id}" />
        <input type="hidden" name="sid" id="sid" value="{$sid}" />
        <dl class="kv">
          <dt>
            <label>上级栏目：</label>
          </dt>
          <dd>
            {$alist}
          </dd>
        </dl>
        <dl class="kv">
          <dt>
            <label>栏目名称：</label>
          </dt>
          <dd>
            <input class="input-text" type="text" name="cname" id="cname" value="{$cname}" required />
            <span class="required">*</span>
            <div class="kv-error"></div>
          </dd>
        </dl>
        <dl class="kv J_stitle"  >
          <dt>
            <label>栏目标题：</label>
          </dt>
          <dd>
            <input class="input-text" type="text" name="pagetitle" id="pagetitle" value="{$pagetitle}" />
          </dd>
        </dl>
        <dl class="kv J_stitle" >
          <dt>
            <label>关键字：</label>
          </dt>
          <dd>
            <input class="input-text" type="text" name="keywords" id="keywords" value="{$keywords}" />
          </dd>
        </dl>
        <dl class="kv">
          <dt>
            <label>描述：</label>
          </dt>
          <dd>
            <textarea rows="8" cols="100" name="description" id="description">{$description}</textarea>
          </dd>
        </dl>
        <dl class="kv">
          <dt>
            <label>seo描述：</label>
          </dt>
          <dd>
            <textarea rows="8" cols="100" name="pagedescription" id="pagedescription">{$pagedescription}</textarea>
          </dd>
        </dl>
        <dl class="kv">
          <dt>
            <label>外部链接：</label>
          </dt>
          <dd>
            <input class="input-text" type="text" name="url" id="url" value="{$url}" />
          </dd>
        </dl>
        <dl class="kv">
          <dt>
            <label>上传图片：</label>
          </dt>
          <dd>
            <div class="tab-pane active">
              <input type="text" class="input-text" id="imageurl" name="imageurl" value="{$imageurl}" />
              <input type="button" class="btn" id="image" value="选择图片" />
            </div>
          </dd>
        </dl>
        <dl class="kv">
          <dt>
            <label>栏目模版：</label>
          </dt>
          <dd>
            <select name="channels">
              <volist name="channelsTemplate" id="channelsTemplate">
                <option value="{$channelsTemplate.template_name}" <eq name="channelsTemplate.template_name" value="$channelTemplate">selected</eq>>{$channelsTemplate.template_name}</option>
              </volist>
            </select>
          </dd>
        </dl>

        <dl class="kv">
          <dt>
            <label>内容模版：</label>
          </dt>
          <dd>
            <select name="contents">
              <volist name="contentsTemplate" id="contentsTemplate">
                <option value="{$contentsTemplate.template_name}" <eq name="contentsTemplate.template_name" value="$contentTemplate">selected</eq>>{$contentsTemplate.template_name}</option>
              </volist>
            </select>
          </dd>
        </dl>
        <dl class="kv">
          <dt>
            <label>生成页面路径：</label>
          </dt>
          <dd>
            <input class="input-text" type="text" name="createurl" id="createurl" value="{$createurl}" />
          </dd>
        </dl>
        <dl class="kv">
          <dt>
            <label>栏目页面命名规则：</label>
          </dt>
          <dd>
            <input class="input-text" type="text" name="catenaming" id="catenaming" value="{$catenaming}" />
            <p class="tip">提示：命名规则里必须存在{id}</p>
          </dd>
        </dl>
        <dl class="kv">
          <dt>
            <label>内容页面命名规则：</label>
          </dt>
          <dd>
            <input class="input-text" type="text" name="artnaming" id="artnaming" value="{$artnaming}" />
            <p class="tip">提示：命名规则里必须存在{id}</p>
          </dd>
        </dl>
        <dl class="kv">
          <dt>
            <label>内容：</label>
          </dt>
          <dd>
            <textarea style="width: 680px; height: 200px;" name="content" id="editor_id">{$content}</textarea>
            <p class="tip">提示：ESC可以全屏</p>
          </dd>
        </dl>
        <dl class="kv">
          <dt>
            <label>栏目分组：</label>
          </dt>
          <dd>
            <volist name="grouplist" id="grouplist">
              <label>
                <input type="checkbox" name="group_name_collection[]" value="{$grouplist.name}" <if condition="in_array($grouplist['name'],$categroup)">checked</if>/>{$grouplist.name} &nbsp;&nbsp;</label>
            </volist>
          </dd>
        </dl>
        <div class="actions">
          <notempty name="id">
            <input class="btn btn-y" type="submit" value="修改" />
            <else/>
            <input class="btn btn-y" type="submit" value="添加" />
          </notempty>
          <input class="btn btn-n" type="button" value="取消" onclick="javascript:history.go(-1);" />
        </div>
      </form>
    </div>
  </div>
</body>

</html>
